package com.mandao.concurrency.interviewset.backdemo;

/**
 * Description
 *      取号
 * @author woniu
 * @date 2019/6/29 11:16
 */
public class NumberMachine {

    /**
     *  单例模式，只有一个取票机
     */
    //<editor-fold desc="直接上饿汉式">
    private NumberMachine(){};
    private static NumberMachine instance = new NumberMachine();
    public static NumberMachine getInstance(){
        return instance;
    }
    //</editor-fold>

    /**
     *  取票机中有三种票，对应各自的取出方法
     *          普通 快速 VIP
     */
    private NumberManager commonManager = new NumberManager();
    private NumberManager expressManager = new NumberManager();
    private NumberManager vipManager = new NumberManager();

    public NumberManager getCommonManager() {
        return commonManager;
    }
    public NumberManager getExpressManager() {
        return expressManager;
    }
    public NumberManager getVipManager() {
        return vipManager;
    }

}
